<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Socket Errors</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sockets.examples.html">范例</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.sockets.html">Socket 函数</a></div>
 <div class="up"><a href="book.sockets.html">Sockets</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sockets.errors" class="chapter">
 <h1>Socket Errors</h1>

 <p class="para">
  The socket extension was written to provide a usable interface to the
  powerful BSD sockets. Care has been taken that the functions work equally
  well on Win32 and Unix implementations. Almost all of the sockets
  functions may fail under certain conditions and therefore emit an
  <strong><code>E_WARNING</code></strong> message describing the error. Sometimes this
  doesn&#039;t happen to the desire of the developer. For example the function
  <span class="function"><a href="function.socket-read.html" class="function">socket_read()</a></span> may suddenly emit an
  <strong><code>E_WARNING</code></strong> message because the connection broke
  unexpectedly. It&#039;s common to suppress the warning with the
  <em>@</em>-operator and catch the error code within the
  application with the <span class="function"><a href="function.socket-last-error.html" class="function">socket_last_error()</a></span> function. You
  may call the <span class="function"><a href="function.socket-strerror.html" class="function">socket_strerror()</a></span> function with this error
  code to retrieve a string describing the error. See their description for
  more information.
 </p>
 <blockquote class="note"><p><strong class="note">Note</strong>: 
  <p class="para">
   The <strong><code>E_WARNING</code></strong> messages generated by the socket
   extension are in English though the retrieved error message will appear
   depending on the current locale (<strong><code>LC_MESSAGES</code></strong>):
   <div class="example-contents screen">
<div class="cdata"><pre>
Warning - socket_bind() unable to bind address [98]: Die Adresse wird bereits verwendet
</pre></div>
   </div>
  </p>
 </p></blockquote>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sockets.examples.html">范例</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.sockets.html">Socket 函数</a></div>
 <div class="up"><a href="book.sockets.html">Sockets</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
